package com.mmall.concurrence.future;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

@Slf4j
public class FutreTaskExample {


    public static void main(String[] args) {
        FutureTask<String> futureTask = new FutureTask<>(new Callable<String>() {
            @Override
            public String call() throws Exception {
                log.info("do someThing in callable");
                Thread.sleep(5000);
                return "Done";
            }
        });


        new Thread(futureTask).start();
    }
}
